/**
 * 首页接口管理
 * @module index
 */
/* eslint-disable */
import {
    apiMethod,
    apiMethodV2,
    apiMethodV3,
    rideMod,
    userMod,
    vehicleMod,
    version,
    wxURL,
    defaultAreaId,
    bigdataUrl,
    config
} from './config'; // 通用方法
import req from './index'

/**
 * [getRouter 获取路由]
 * @param {Object} options
 */
export const getRouter = options => {
    const url = `api/v2/getrouter`;
    return req.request(url, "post", options, 1);
}

/**
 * [getCode 发送验证码](总 - API)
 * @param {Object} options => 请求参数
 */
export const getCode = options => {
    const url = `rider/api/v3/message/${options.mobileNum}`;
    return req.request(url, "get", null, 3, true);
}

/**
 * [userLogin 用户登录](总 - API)
 * @param {Object} options => 请求参数
 */

export const userLogin = options => {
    const url = `rider/api/v3/login`;
    return req.request(url, "post", options, 3, true);
}

/**
 * [getUserOrder 获取用户订单]
 * @param {Object} options
 */
export const getUserOrder = options => {
    const url = `bike/v2/riding/order`;
    return req.request(url, "get", options, 2);
}

/**
 * [getPowerConfig 获取配置信息]
 * @param {Object} options
 */

export const getPowerConfig = options => {
    const url = `bike/v2/config`;
    return req.request(url, "get", null, 2, true);
}

/**
 * [getVehicle 获取车辆信息]
 * @param {Object} options
 */

export const getVehicle = options => {
    const url = `vehicle/v2/${options.customNo}`;
    return req.request(url, "get", options, 2);
}

/**
 * [getHasUnsettlementOrder 是否有未支付订单信息]
 * @param {Object} options
 */
export const getHasUnsettlementOrder = options => {
    const url = `rider/api/v3/settlement/hasUnsettlementOrder`;
    return req.request(url, "get", options, 3);
}

/**
 * [getApiVhicle 获取车辆列表信息](分 - API)
 * @param {Object} options
 */
export const getApiVhicle = options => {
    const url = `vehicle/v2/list`;
    return req.request(url, "get", options, 2);
}

/**
 * [getParkingspot 获取附近停车点列表](分 - API)
 * @param {Object} options
 */
export const getParkingspot = options => {
    const url = `vehicle/v2/parkingSpot`;
    return req.request(url, "get", options, 2);
}

/**
 * [getBannerInfo 获取banner图]
 * @param {Object} options
 */
export const getBannerInfo = options => {
    const url = `invitation/banner/`;
    return req.request(url, "get", options, 1);
}

/**
 * [getAdTips 获取弹窗]
 * @param {Object} options
 */
export const getAdTips = options => {
    const url = `invitation/advertise/tips`;
    return req.request(url, "get", options, 1, true);
}

/**
 * [unlockCar 开锁]
 * @param {Object} options
 */
export const unlockCar = options => {
    const url = `bike/v3/unlock`;
    return req.request(url, "post", options, 2);
}

/**
 * [tempLockCar 临时锁车]
 * @param {Object} options
 */
export const tempLockCar = options => {
    const url = `bike/v3/tempLock`;
    return req.request(url, "post", options, 2);
}

/**
 * [tempUnlockCar 临时开锁]
 * @param {Object} options
 */
export const tempUnlockCar = options => {
    const url = `bike/v3/tempUnlock`;
    return req.request(url, "post", options, 2);
}

/**
 * [lockCar 关锁]
 * @param {Object} options
 */
export const lockCar = options => {
    const url = `bike/v3/lock`;
    return req.request(url, "post", options, 2);
}

/**
 * [getUsers 获取个人中心]
 * @param {Object} options
 */
export const getUserCenter = options => {
    const url = `user/api/v3/users/`;
    return req.request(url, "get", options, 1);
}

/**
 * [findTheCar 寻车铃](分 - API)
 * @param {Object} options
 */
export const findTheCar = options => {
    const url = `bike/v2/riding`;
    return req.request(url, "post", options, 2);
}

/**
 * [unlockCancel 取消开锁](分 - API)
 * @param {Object} options
 */

export const unlockCancel = options => {
    const url = `bike/v3/unlockCancel`;
    return req.request(url, "post", options, 2);
}

/**
 * [getRidingBill 获取骑行结束支付订单详情]
 * @param {Object} options
 */
export const getRidingBill = options => {
    const url = `rider/api/v3/pay/settlementInfo`;
    return req.request(url, "post", options, 3);
}

/**
 * [cashierPay 收银台支付]
 * @param {Object} options
 */
export const cashierPay = options => {
    const url = `cashier/pay`;
    return req.request(url, "post", options, 1);
}

/**
 * 获取卡券列表
 * @method getNewCouponList
 * @param {data}
 **/
export const getNewCouponList = options => {
    const url = `cashier/payOrder/${options.payOrderNo}/${options.payMethodId}/couponList`;
    return req.request(url, "get", options, 1);
}

/**
 * 获取卡券详情
 */
export const getCoupon = options => {
    const url = `rider/api/v3/pay/coupon`;
    return req.request(url, "get", options, 3);
}


/**
 * [getPayStatus 获取支付状态]
 * @param {Object} options
 */
export const getPayStatus = options => {
    const url = `cashier/payOrder/${options.payOrderNo}/status`;
    return req.request(url, "get", options, 1);
}

/**
 * [getRecommendRidePackage 获取支付订单详情推荐骑行卡包信息]
 * @param {Object} options
 */
export const getRecommendRidePackage = options => {
    const url = `rider/api/v3/pay/recommendRidePackage`;
    return req.request(url, "get", options, 3);
}

/**
 * [payOrder 发起骑行结束订单支付]
 * @param {Object} options
 */
export const payOrder = options => {
    const url = `rider/api/v3/pay/settlementPay`;
    return req.request(url, "post", options, 3);
}

/**
 * [getPayMethods 获取支付方式]
 * @param {Object} options
 */
export const getPayMethods = options => {
    const url = `cashier/payOrder/${options.payOrderNo}/payMethod`;
    return req.request(url, "get", options, 1);
}

/**
 * [getMsgCount 获取消息信息]
 * @param {Object} options
 */
export const getMsgCount = options => {
    const url = `${userMod}${apiMethodV2}msg/unreadCount`;
    return req.request(url, 'get', options, 1)
}


/**
 * [getUserInfoV3 获取钱包表]
 * @param {Object} options
 */
export const getUserInfoV3 = options => {
    const url = `${userMod}${apiMethodV3}users/`;
    return req.request(url, 'get', options, 1)
}

/**
 * [getWalletV3 获取钱包表]
 * @param {Object} options
 */
export const getWalletV3 = options => {
    const url = `${userMod}${apiMethodV3}wallet`;
    return req.request(url, 'get', options, 1)
}

/**
 * [fetchAgreement 获取协议内容](总 - 数据表)
 * @param {Object} options
 */
export const fetchAgreement = options => {
    const url = 'article';
    return req.request(url, 'get', options, 1)

}

/**
 * [authFn 用户认证](总 - 数据表)
 * @param {Object} options
 */
export const authFn = options => {
    const url = `${userMod}${apiMethodV2}realname`;
    return req.request(url, 'post', options, 1)
}

/**
 * [实名之后的砍押接口 获取bannerInfo]
 * @param {Object} options
 */
export const checkCut = options => {
    const url = `invitation/kanyajin/check`;
    return req.request(url, 'get', options, 1)
}

/**
 * [getRegistration 获取]
 * @param {Object} options
 */
export const getRegistration = options => {
    const url = `invitation/registration/activity`;
    return req.request(url, 'get', options, 1)
}

/**
 * [updateAuthInfo 修改认证后的用户信息，用于实名认证](总 - 数据表)
 * @param {Object} options
 */
export const updateAuthInfo = (options) => {
    const url = `${userMod}${apiMethodV2}realname`
    return req.request(url, 'post', options, 1)
}

/**
 * [getOpenIdV3 获取openId]
 * @param {Object} options
 */
export const getOpenIdV3 = options => {
    const url = `user/api/v3/getopenid`;
    return req.request(url, 'get', options, 1, true)
}

/**
 * [getVirtual 获取可区域配置金额](总 - 数据表)
 * @param {Object} options
 */
export const getPayDeposit = options => {
    const url = `${userMod}${apiMethodV2}pay/deposit`;
    return req.request(url, 'get', options, 1)
}

/**
 * [quickPaySetting 获取快捷支付方式]
 * @param {Object} options
 */
export const getQuickPaySetting = options => {
    const url = `rider/api/v3/wallet/quickPaySetting`;
    return req.request(url, 'get', options, 3)
}

/**
 * [getWalletV3 获取退余额中弹窗]
 * @param {Object} options
 */
export const getRefundBalanceFormV3 = options => {
    const url = `${userMod}${apiMethodV3}wallet/refundBalanceForm`;
    return req.request(url, 'get', options, 1)
}

/**
 * [getVirtual 获取可充值金额列表](总 - 数据表)
 * @param {Object} options
 */
export const getVirtual = options => {
    const url = `${userMod}${apiMethodV2}virtual`;
    return req.request(url, 'get', options, 1)
}


/**
 * [isrefund 退款状态]
 * @param {Object} options
 */
export const isrefund = options => {
    const url = `user/api/v2/wallet/isrefund`;
    return req.request(url, 'post', options, 1)
}


/**
 * [wxpayRecharge 微信充值](分 - API)
 * @param {Object} options
 */
export const wxpayRecharge = options => {
    const url = `${userMod}${apiMethodV2}pay/wxpay_recharge`;
    return req.request(url, 'post', options, 1)
}

/**
 * [getDiscount 获取优惠券列表]
 * @param {Object} options
 */
export const getCouponList = options => {
    const url = `${userMod}${apiMethodV2}coupon`;
    return req.request(url, 'get', options, 1)
}

/**
 * 获取卡包列表
 * @method getPackageList
 * @param {data}
 *
 */
export const getPackageList = options => {
    const url = `rider/api/v3/package`;
    return req.request(url, 'get', options, 3)
}

/**
 * [getWallentDetail 核销码]
 * @param {Object} options
 */
export const couponCode = options => {
    const url = `invitation/couponCode/verify`;
    return req.request(url, 'put', options, 1)
}


/**
 * [getWallentDetail 获取钱包支付明细]
 * @param {Object} options
 */
export const getWallentdetail = options => {
    const url = `user/api/v2/wallet/walletdetail/`;
    return req.request(url, 'get', options, 1)
}

/**
 * [getMytrip 获取我的行程]
 * @param {Object} options
 */
export const getMytrip = options => {
    const url = `user/api/v2/myJourneys/`;
    return req.request(url, 'get', options, 1)
}


/**
 * [getAuthorizeInfo 查询授权信息]
 * @param {Object} options
 */
export const getAuthorizeInfo = options => {
    const url = `rider/${apiMethodV3}authorizeInfo`;
    return req.request(url, 'get', options, 3)
}

/**
 * [orderIsPaid 查询骑行订单是否已支付]
 * @param {Object} options
 */
export const orderIsPaid = options => {
    const url = `rider/api/v3/pay/${options.orderNo}/isPaid`;
    return req.request(url, 'get', options, 3)
}

/**
 * [orderRiding 账单支付信息](总 - 数据表)
 * @param {Object} options
 */
export const orderRiding = options => {
    const url = `${rideMod}${version}riding/bill/${options.orderNo}`;
    return req.request(url, 'get', options, 2)
}








